package com.megvii.corelib.util;

/**
 * Created by linyue on 16/1/5.
 */
public class ColorUtil
{
    public static int hashStringToARGBColor(String str, int alpha)
    {
        int color;
        if (str == null)
        {
            color = 0x00000000;
        }
        else
        {
            int hash = str.hashCode();
            color = hash & 0x00FFFFFF;
        }
        return (alpha << 24) | color;
    }

    public static int getRevertColor(int argb)
    {
        int a = argb & 0xFF000000;
        int rgb = argb & 0x00FFFFFF;
        rgb = 0x00FFFFFF - rgb;
        rgb = a | rgb;
        return rgb;
    }
}
